<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of AutorPaper
 *
 * @author cshepherd
 */
class AutorPaper extends AutorPaperDAO{

    public function contador($table,$atribute, $condicion) {
        try {
            $cont = $this->count($table, $atribute, $condicion);
            return $cont;
        }catch (Exception $e) {
            throw $e;
        }
    }

    public function insertar($id_autor,$id_paper){
    	try{
            $objetoTO = new AutorPaperTO;
            $objetoTO->setIdAutor($id_autor);
            $objetoTO->setIdPaper($id_paper);
            return $this->insert($objetoTO);
    	}
    	catch(Exception $e){
      		throw $e;
    	}
    }

    public function listar($condition='TRUE', $page='1', $rows_per_page='20', $order_by='id_autor_paper', $order_by_type='DESC') {
    	try{
      		$data = $this->select('*',$condition, $page, $rows_per_page, $order_by, $order_by_type);
      		return $data;
    	}
    	catch(Exception $e){
      		throw $e;
    	}
  	}

    public function obtenerAutorPaper($objAutorPaperTO){
        try{
 			//$this->validarFormularioLogin($data['usuario'], $data['password']);
            return $this->load($objAutorPaperTO);
 		}
 		catch(Exception $e){
 			throw $e;
 		}
    }
}
?>
